#ifndef WAVE_H
#define WAVE_H

#include <QWidget>
#include <QMainWindow>
#include <QtCharts/QChartView>//显示图表
#include <QtCharts/QLineSeries>//线系列
#include <QDoubleSpinBox>
#include <QGridLayout>
#include <QTimer>
#include <QtCharts/QSplineSeries>
#include <QtCharts/QValueAxis>

QT_CHARTS_USE_NAMESPACE

namespace Ui {
class wave;
}

class wave : public QWidget
{
    Q_OBJECT

public:
    explicit wave(QWidget *parent = nullptr);
    ~wave();
    void setTitle(QString title);
    void close();
    void set_value(float value);

private slots:
    void RealtimeDataSlot();

private:
    Ui::wave *ui;
    QTimer m_timer;
    QChart chart;
    QSplineSeries m_series;
    QStringList m_titles;
    QValueAxis m_axis;
    qreal m_step;
    qreal m_x;
    qreal m_y;
    QString m_title;

};

#endif // WAVE_H
